package com.dazhao.animejaphome.home.animeResMVP;

import com.dazhao.animejaphome.home.model.AnimeResModel;

import javax.inject.Inject;

/**
 * Created by zhao on 2017/12/25.
 */

public class Presenter implements MVP_Contract.Presenter {
    MVP_Contract.View mView;
    MVP_Contract.Model mModel;

    @Inject public Presenter(MVP_Contract.View view){
        mView=view;
        if(mModel==null){
            mModel=new AnimeResModel();
        }
    }

    @Override
    public void detach(){
        mView=null;
    }

    @Override
    public void initItems() {
        mView.setAdapter(mModel.getData());
    }

    @Override
    public void setDeleteFunction() {
        mModel.setOnDeleteLocalEvent();
        mView.setDeleteCallBack();
    }

    @Override
    public void resetDataView() {
        mModel.resetData();
        mView.resetView();

    }
}
